package 简单工厂模式;

public class OperationFactory {
    public  static  Operation createOperation(String operate){
        Operation operation;
        switch (operate){
            case "+":
                operation = new Addition();
                break;
            case "-":
                operation = new Subtraction();
                break;
            case "*":
                operation = new Multiplication();
                break;
            case "/":
                operation = new Division();
                break;
            default:
                operation = new Addition();
                break;

        }
        return operation;
    }
}
